@extends("base.base")
@include('User.Order.header')
@section('main')
    <link rel="stylesheet" href="{{asset(env('CDN_HOST')."/public/css/order/list.css")}}">
    <main id="main" class="main">
        @if(empty($parent_order))
            <div id="empty_order" class="empty_order">
                <img class="empty_order-img" src="{{asset(env("CDN_HOST")."/img/cart/cart.png")}}" alt="">
                <p class="empty_order-p">去买点儿东西吧</p>
            </div>
        @else
            <div id="order_list" class="order_list">
                @foreach($parent_order as $key => $value)
                    <div class="parent_order_box" data-order-id="{{$value["parent_order_id"]}}">
                        <div class="order_title">
                        <span class="order_number">
                            订单编号：{{$value["parent_order_id"]}}
                        </span>
                            <span class="order_delete">
                            <i class="fa fa-trash-o" aria-hidden="true"></i>
                        </span>
                        </div>
                        <div class="order_content">
                            <div class="order_box">
                                @foreach($value["data"] as $k => $v)
                                    <div class="img_box" data-order-id="{{$v["order_id"]}}">
                                        <img class="order_img" src="{{$v["info_img_url"]}}" alt="">
                                    </div>
                                @endforeach
                            </div>
                            <div class="order_state">
                                <span class="order_state_name"
                                      data-state="{{$value["state"]}}">{{$value["state_name"]}}</span>
                            </div>
                        </div>
                    </div>
                @endforeach
            </div>
        @endif
    </main>
@endsection